import 'package:flutter/material.dart';
import 'package:szwf/routes.dart';

class PageContent extends StatelessWidget {
  final String name;

  const PageContent({Key key, this.name}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Center(
          child:Text('当前页面: $name') ,
        )
      ),
      body: ListView(
        children: <Widget>[
          FlatButton(
            child: Text(Routes.login),
            onPressed: (){
              Navigator.pushNamed(context,Routes.login);
            },
          ),
          FlatButton(
            child: Text('不存在的资源'),
            onPressed: (){
              Navigator.pushNamed(context,'/404');
            },
          ),
          FlatButton(
            child: Text('详情'),
            onPressed: (){
              Navigator.pushNamed(context,'/room/222');
            },
          ),
        ],
      ),
    );
  }
}
